<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script type="text/javascript">
    $(function () {
        var clinicId=$("#clinicIdVal").val();
        $("#saveBtn").on('click', function () {
            if ($('#inputForm').parsley().validate()) {
                $.ajax({
                    type: "POST",
                    data: $("#inputForm").serialize(),
                    url: "${ctx}/oper/patMasterIndex/updateInfo?clinicId="+clinicId,
                    dataType: "json",
                    success: function (data) {
                        toastr.success(data.data);
                    },
                    error: function (data) {
                        toastr.error('网络连接错误,请检查网络');
                    }
                });
            }
            return false;
        })
    })

</script>

<div class="panel-body" style="padding-top:10px;background-color: white;">
    <div class="col-lg-9">
        <form:form id="inputForm" modelAttribute="patMasterIndex" method="post" class="form-horizontal">
            <form:hidden path="id"/>
            <div class="form-group">
                <label class="col-sm-4 control-label">姓名：</label>

                <div class="col-sm-5">
                    <form:input path="name" htmlEscape="false" maxlength="50" class="form-control"
                                data-parsley-required="true"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">性别：</label>

                <div class="col-sm-5">
                    <form:select path="sex" class="form-control" data-parsley-required="true">
                        <form:option value="" label=""/>
                        <form:options items="${fns:getDictList('SEX_DICT')}" itemLabel="label" itemValue="value"
                                      htmlEscape="false"/>
                    </form:select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">年龄：</label>

                <div class="col-sm-5">
                    <form:input path="age" id="age" htmlEscape="false" maxlength="50" class="form-control"
                                data-parsley-required="true"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">费别：</label>

                <div class="col-sm-5">
                    <form:select path="chargeType" class="form-control" data-parsley-required="true">
                        <form:option value="" label="----请选择----" selected="selected"/>
                        <form:options items="${fns:getDictList('CHARGE_TYPE_DICT')}" itemLabel="label" itemValue="value"
                                      htmlEscape="false"/>
                    </form:select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">身份：</label>

                <div class="col-sm-5">
                    <form:select path="identity" class="form-control">
                        <form:options items="${fns:getDictList('PROFESSION_DICT')}" itemLabel="label" itemValue="value"
                                      htmlEscape="false"/>
                    </form:select>
                </div>
                    <%--<div class="col-sm-5">--%>
                    <%--<form:input path="identity" htmlEscape="false" maxlength="50" class="form-co ntrol" data-parsley-required="true" />--%>
                    <%--</div>--%>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">身份证号：</label>

                <div class="col-sm-5">
                    <form:input path="idNo" id="idNo" class="form-control"
                                data-parsley-checkidcard="3" maxlength="100" onchange="getBaseinfo('idNo','age')"
                                onblur="return validPersonInfoUnique('idCard','idCard','personId','${ctx}/sys/sysLoginName/validateUnique');"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">合同单位：</label>

                <div class="col-sm-5">
                    <form:input path="unitInContract" htmlEscape="false" maxlength="50" class="form-control"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">住址：</label>

                <div class="col-sm-5">
                    <form:input path="address" htmlEscape="false" maxlength="50" class="form-control"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label"></label>

                <div class="col-sm-5">
                    <input id="saveBtn" class="btn btn-primary" type="button" value="保 存"/>
                </div>
            </div>
        </form:form>
    </div>
</div>
